{% extends 'base.html' %}
{% load static %}
{% block title %}投票首页{% endblock %}
{% block content %}
    <h1 class="text-center text-warning">投票首页</h1>
    <div class="h4" style="margin-top: 20px">
            {% comment %}questions是views.index传过来的参数，question自定义的{% endcomment %}
            {% for question in questions %}
                <div>  {% comment %}forloop.counter是模板语言中循环的计数器{% endcomment %}
                    {{ forloop.counter }}.
            {#        <a href="/polls/{{ question.id }}" target="_blank">#}
                    <a href="{% url 'detail' question_id=question.id %}" target="_blank">
                        {{ question.question_text }}
                    </a>
                    {{ question.pub_date }}
                </div>
            {% endfor %}
        </div>
{% endblock %}